package com.zkdcloud.service;

import com.zkdcloud.domain.FeedBack;
import com.zkdcloud.repository.FeedbackDao;
import com.zkdcloud.util.RandomUtil;
import org.jfaster.mango.plugin.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zk123
 * @version 2018/5/24
 */
@Service
public class FeedBackService {
    @Autowired
    private FeedbackDao feedbackDao;

    /**
     * 反馈列表
     *
     * @param feedBack 反馈
     */
    public void add(FeedBack feedBack){
        feedBack.setId(RandomUtil.getUUID());
        feedBack.setCreateTime(System.currentTimeMillis());
        feedbackDao.add(feedBack);
    }

    /**
     * 获取反馈列表
     *
     * @param page page
     * @return list
     */
    public List<FeedBack> getFeedBack(Page page){
        return feedbackDao.getAll(page);
    }
}
